﻿module RenderTests

open NUnit.Framework
open Layout
open MockDisplayElements


[<TestFixture>]
type testScanning() = 

    [<Test>]
    member self.testRender() =
        let elem = SElement("", [SText("abcd abcd")])
        let layout = layoutRoot elem 1000
        Assert.AreEqual(23, layout.size.height)

    [<Test>]
    member self.testLinebreak() =
        (* should cause line break. Letters have a height of 20 and hence a width of about 10 *)
        let elem = SElement("", [SText("abcd abcd")])
        let layout = layoutRoot elem 50
        Assert.AreEqual(46, layout.size.height)

    [<Test>]
    member self.testLinebreak2() =
        let elem = SElement("", [SText("abcd abcd abcd")])
        let layout = layoutRoot elem 100
        Assert.AreEqual(46, layout.size.height)     



